🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / domain / src / commonTest / kotlin / org / meshtastic / core / domain / usecase / settings / ImportSecurityConfigUseCaseTest.kt
Displaying Raw • Download
core/domain/src/commonTest/kotlin/org/meshtastic/core/domain/usecase/settings/ImportSecurityConfigUseCaseTest.kt 7a42a34dbcd11b4800cc9c6130b3f4d87ab945df (7a42a34d) Text, 1.61 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.domain.usecase.settings
Tff7b72import T7ee787org.meshtastic.core.repository.StoredSecurityKeys
Tff7b72import T7ee787kotlin.test.BeforeTest
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertEquals
Tff7b72import T7ee787kotlin.test.assertTrue
Tff7b72class T56d364ImportSecurityConfigUseCaseTest Tb4b4b4{
Tff7b72private Tff7b72lateinit Tff7b72var Te6edf3useCaseTb4b4b4: Te6edf3ImportSecurityConfigUseCase
Tf0883e@BeforeTest
Tff7b72fun Td2a8ffsetUpTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3useCase Tff7b72= Te6edf3ImportSecurityConfigUseCaseTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`invoke decodes a valid backup into a SecurityConfig`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3stored Tff7b72= Te6edf3StoredSecurityKeysTb4b4b4(Te6edf3publicKeyBase64 Tff7b72= Ta5d6ff"Ta5d6ffAQIDTa5d6ff"Tb4b4b4, Te6edf3privateKeyBase64 Tff7b72= Ta5d6ff"Ta5d6ffBAUGTa5d6ff"Tb4b4b4, Te6edf3timestamp Tff7b72= T79c0ff1T79c0ff2T79c0ff3LTb4b4b4)
Tff7b72val Te6edf3result Tff7b72= Te6edf3useCaseTb4b4b4(Te6edf3storedTb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3isSuccessTb4b4b4)
Tff7b72val Te6edf3config Tff7b72= Te6edf3resultTb4b4b4.Te6edf3getOrThrowTb4b4b4(Tb4b4b4)
Te6edf3assertEqualsTb4b4b4(Te6edf3byteArrayOfTb4b4b4(T79c0ff1Tb4b4b4, T79c0ff2Tb4b4b4, T79c0ff3Tb4b4b4)Tb4b4b4.Te6edf3toListTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3configTb4b4b4.Te6edf3public_keyTb4b4b4.Te6edf3toByteArrayTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3toListTb4b4b4(Tb4b4b4)Tb4b4b4)
Te6edf3assertEqualsTb4b4b4(Te6edf3byteArrayOfTb4b4b4(T79c0ff4Tb4b4b4, T79c0ff5Tb4b4b4, T79c0ff6Tb4b4b4)Tb4b4b4.Te6edf3toListTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3configTb4b4b4.Te6edf3private_keyTb4b4b4.Te6edf3toByteArrayTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3toListTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.05s